<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
    <div class="container">
        <a class="navbar-brand" href="{{ url_for('index') }}">我的博客</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item">
                    <a class="nav-link" href="{{ url_for('index') }}">首页</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{{ url_for('blog') }}">博客</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{{ url_for('movies') }}">电影</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{{ url_for('movie_recommendations') }}">推荐</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{{ url_for('music') }}">音乐</a>
                </li>
            </ul>
            <ul class="navbar-nav">
                {% if current_user.is_authenticated %}
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('new_post') }}">写文章</a>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" 
                           data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            {{ current_user.name }}
                        </a>
                        <div class="dropdown-menu dropdown-menu-right">
                            <a class="dropdown-item" href="{{ url_for('settings') }}">设置</a>
                            <div class="dropdown-divider"></div>
                            <a class="dropdown-item" href="{{ url_for('logout') }}">退出</a>
                        </div>
                    </li>
                {% else %}
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('login') }}">登录</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('register') }}">注册</a>
                    </li>
                {% endif %}
            </ul>
        </div>
    </div>
</nav> 